package com.googlecode.continuity.core.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.googlecode.continuity.core.client.debug.ConsoleUtils;

/**
 * GWTDebug
 * <p/>
 * A debugging helper that catches (most) unhandled exceptions and prints them to the fireburg console.
 *
 * todo: remove/replace
 * @deprecated replaced with gwt-log
 * @author Peter Schmitt <aragos@aragos.de>
 */
public class GWTDebug implements EntryPoint {

  public void onModuleLoad() {
    // TODO: this is debug only!
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
      public void onUncaughtException(Throwable throwable) {
        ConsoleUtils.error("An uncaught exception occured:" + throwable.getMessage(), throwable.getCause());
      }
    });
  }
}
